<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('member_ranks', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('member_id')->unsigned()->comment('会员ID');
            $table->bigInteger('store_id')->unsigned()->comment('店铺ID');
            $table->decimal('total_money')->default(0)->comment('总消费金额');
            $table->integer('total_assistant_minutes')->default(0)->comment('总助教分钟数');
            $table->integer('total_assistant_count')->default(0)->comment('总助教次数');
            $table->integer('total_assistant_project_count')->default(0)->comment('总助教项目数');
            $table->integer('total_assistant_project_minutes')->default(0)->comment('总助教项目分钟数');
            $table->integer('total_point')->default(0)->comment('总积分');
            $table->date('count_date')->comment('统计日期');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('member_ranks');
    }
};
